<include file="public@header"/>
</head>
<body>
<div class="wrap js-check-wrap">
    <ul class="nav nav-tabs">
        <li class="active"><a href="{:url('Goods/index')}">商品列表</a></li>
        <li><a href="{:url('Goods/add')}">添加商品</a></li>
    </ul>
    <form class="well form-inline margin-top-20" method="get" action="{:url('Goods/index')}">
        <input type="text" class="form-control" name="keyword" style="width: 200px;" value="{:input('request.keyword/s','')}" placeholder="请输入商品名称">
        <input type="submit" class="btn btn-primary" value="搜索" />
        <a class="btn btn-danger" href="{:url('Goods/index')}">清空</a>
    </form>
    <form method="post" class="js-ajax-form margin-top-20" action="{:url('Goods/order')}">
        <div class="table-actions">
            <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">排序</button>
        </div>

        <table class="table table-hover table-bordered table-list">
            <thead>
            <tr>
                <th width="16"><label><input type="checkbox" class="js-check-all" data-direction="x" data-checklist="js-check-x"></label></th>
                <th width="50">{:lang('SORT')}</th>
                <th width="50">ID</th>
                <th>标题</th>
                <th>封面图</th>
                <th>图集</th>
                <th>分类id</th>
                <th>运费</th>
                <th>运营类型</th>
                <th>商品状态</th>
                <th>创建时间</th>
                <th>修改时间</th>
                <th width="120">{:lang('ACTIONS')}</th>
            </tr>
            </thead>
            <tbody>
            <volist name="goodsList" id="goods">
                <tr>
                    <td><input type="checkbox" class="js-check" data-yid="js-check-y" data-xid="js-check-x" name="ids[]" value="{$goods.id}"></td>
                    <td><input name="list_orders[{$goods.id}]" class="input input-order mr5" type="text" style="width: 50px;" value="{$goods.list_order}"></td>
                    <td>{$goods.id}</td>
                    <td>{$goods.title}</td>
                    <td><img src="/upload/{$goods.image}" style="height: 40px; width: 80px;" onclick="imagePreviewDialog(this.src)" class="img-thumbnail js-image-previewer"></td>
                    <td>
                        <foreach name="$goods['images']" item="img">
                            <img src="/upload/{$img}" class="img-thumbnail" onclick="imagePreviewDialog(this.src)" style="width: 80px">
                        </foreach>
                    </td>
                    <td>{$goods.gid}</td>
                    <td>{$goods.price}</td>
                    <td>{$typeMap[$goods.type]}</td>
                    <td>
                        <a href="{:url('Goods/changeStatus', ['id' => $goods['id']])}" class="btn btn-xs
                            <eq name='$goods.switch' value='0'> btn-danger</eq>
                            <eq name='$goods.switch' value='1'> btn-success</eq>
                            <eq name='$goods.switch' value='2'> btn-warning</eq>
                            js-ajax-dialog-btn"
                           data-msg="确定切换状态吗？">
                            {$statusMap[$goods.switch]}
                        </a>
                    </td>
                    <td>{$goods.create_time}</td>
                    <td>{$goods.update_time}</td>
                    <td>
                        <li><a href="javascript:void(0);"  onclick="openIframeLayer('setGoodsAttr?goods_id={$goods.id}','配置商品属性',{area: ['60%','80%']})">配置商品属性</a></li>
                        <li><a href="javascript:void(0);"  onclick="openIframeLayer('setGoodsAttrValue?goods_id={$goods.id}','配置商品属性值',{area: ['60%','80%']})">配置商品属性值</a></li>
                        <li><a href="javascript:void(0);"  onclick="openIframeLayer('setGoodsAttrs?goods_id={$goods.id}','配置商品属性值',{area: ['60%','80%']})">配置属性值</a></li>
                        <a href="{:url('Goods/edit', ['id' => $goods['id']])}">{:lang('EDIT')}</a>
                        <a href="{:url('Goods/delete', ['id' => $goods['id']])}" class="js-ajax-delete">{:lang('DELETE')}</a>
                    </td>
                </tr>
            </volist>
            </tbody>
        </table>

        <div class="table-actions">
            <button class="btn btn-sm btn-primary js-ajax-submit" type="submit">排序</button>
        </div>
        <div class="pagination">
            {$page}
        </div>
    </form>
</div>
<script src="__STATIC__/js/admin.js"></script>
</body>
</html>
